<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script>
    var even = 0;
    var odd = 0;
    for (var i = 0;i <=100;i++){
        if(i % 2 == 0){
            even = even + i;
        }else {
            odd = odd + i;
        }
    }
    alert('偶数相加的和为'+even+'奇数相加的和为'+odd);
</script>
<body>

</body>
</html>